/* -----------------------------------------------------------------------------
 * PROJECT    : lwf
 * FILE       : FractionActionHelper.java
 *
 * HISTORY:
 * Date          Author                        Description
 * ----------------------------------------------------------------------------- 
 * Mar 16, 2011  mycodetalks			       Created
 */
package net.lwf.web.struts.action.maths.faction;

import lwf.handler.IProcessHandler;
import lwf.web.struts.action.constant.IActionConstant;
import net.lwf.handler.constant.IHandlerConstant;
import net.lwf.handler.math.fraction.FractionComparisonHandler;
import net.lwf.handler.math.fraction.SimpleFractionHandler;
import net.lwf.web.constant.IPageTitle;

/**
 * Class description goes here
 */
public class FractionActionHelper {
	
	public static IProcessHandler getHandler(String operation, String grade) {
		if(operation.equals(IHandlerConstant.SIMPLE)) {
			return new SimpleFractionHandler(grade, operation);
		}
		else if(operation.equals(IHandlerConstant.COMPARISON)) {
			return new FractionComparisonHandler(grade, operation);
		}
		return null;
	}
	
	public static String getPdfLink(String operation) {
		if(operation.equals(IHandlerConstant.SIMPLE)) {
			return IActionConstant.SIMPLE_FRACTIONS_PDF_LINK;
		}
		else if(operation.equals(IHandlerConstant.COMPARISON)) {
			return IActionConstant.COMPARE_FRACTIONS_PDF_LINK;
		}

		return "";
	}
	
	public static String getQuizLink(String operation) {
		if(operation.equals(IHandlerConstant.SIMPLE)) {
			return IActionConstant.SIMPLE_FRACTIONS_QUIZ_LINK;
		}
		else if(operation.equals(IHandlerConstant.COMPARISON)) {
			return IActionConstant.COMPARE_FRACTIONS_QUIZ_LINK;
		}

		return "";
	}
	
	public static String getPageTitle(String operation) {
		if(operation.equals(IHandlerConstant.SIMPLE)) {
			return IPageTitle.SIMPLE_FRACTONS;
		}
		else if(operation.equals(IHandlerConstant.COMPARISON)) {
			return IPageTitle.COMPARING_FRACTIONS;
		}

		return null;
	}

}



